/**
 * 
 */
package com.zxc.redis.RAtomicDouble;

import org.redisson.Redisson;
import org.redisson.api.RAtomicDouble;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

/**
 * @author Administrator
 *
 */
public class RAtomicDoubleDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Config config = new Config();
		config
			//.setCodec(new FstCodec())
			.useSingleServer() //单例模式
			.setAddress("192.168.1.122:6379")//连接地址
			.setDatabase(1) // 数据库索引位置
			.setPassword("shijie99test") // 密码
			.setClientName("channelbatch") // 客户端名称
			;
		RedissonClient redisson = Redisson.create(config);
		
		RAtomicDouble atomicDouble = redisson.getAtomicDouble("myAtomicDouble");
		atomicDouble.set(2.81);
		atomicDouble.addAndGet(4.11);
		atomicDouble.get();
		
		redisson.shutdown();
	}

}
